`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    18:40:32 04/19/2014 
// Design Name: 
// Module Name:    VGAdigits 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module VGAdigits(digitOUT, digitIN, blank, hcount, vcount, xPos, yPos);
	
	input	[3:0] digitIN;  //value to display
	output digitOUT;		// signal to indicate digit to VGA driver
	
	input blank;			// control and location signals
	input signed [11:0] hcount, vcount, xPos, yPos;
	
	reg[48:1] digitGrid; // set which pixels are on/off for each digit base on 12x16 grid
	
	always @ (digitIN) begin
	
	case (digitIN)
	4'h 0: begin
			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
				end
		4'h 1 : begin
			digitGrid <= 48'b 000100001100011100001100001100001100001100011110;
				end
		4'h 2 : begin																						
			digitGrid <= 48'b 011100111110100011000011000110001100011000111111;
				end
		4'h 3 : begin
			digitGrid <= 48'b 0011110010001000001001110000001000001010001011110;
				end
		4'h 4 : begin
			digitGrid <= 48'b 010010110010110010111111000010000010000010000010;
				end
		4'h 5 : begin
			digitGrid <= 48'b 111111110000110000111110000001100001010010001100;
				end
		4'h 6 : begin
			digitGrid <= 48'b 001110010001110000111110110001110001110001011110;
				end
		4'h 7 : begin
			digitGrid <= 48'b 111111100011000110001100011000011000011000011000;
				end
		4'h 8 : begin
			digitGrid <= 48'b 011110100001100001011110100001100001100001011110;
				end
		4'h 9 : begin
			digitGrid <= 48'b 011110100011100011100011011111000011100010011100;
				end
//		4'h A : begin
//			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
//				end
//		4'h B : begin
//			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
//				end
//		4'h C : begin
//			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
//				end
//		4'h D : begin
//			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
//				end
//		4'h E : begin
//			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
//				end
//		4'h F : begin
//			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
//				end	
		default: begin // this default condition shouldn't be reached, but just in case
			digitGrid <= 48'b 001100010010100011100101101001110001010010001100;
				end
		endcase
	end
	
	digGrid drawDigit(digitGrid, hcount, vcount, blank, xPos, yPos, digitOUT);
	
endmodule
